<?php
require_once './database/connection.php';
require_once './database/search.php';
$obj = new search_data();

?>
<div id="content">
    <form method="post" action="index_6.php">
   <input type="text" name="timkiem">
    <input type="submit" name="ok" value="Tim Kiem">
    </form>
    <?php
    if (isset($_POST['ok'])){
        $data = $obj->timkiem($_POST['timkiem']);
        foreach ($data as $dulieu){
        echo '<div class="post"><h1 class="title"><a href="index_1.php?view='.$dulieu['id'].'">'.$dulieu['title'].'</a></h1><p class="meta"><small>'.date('d-m-y') . ' '.'<a href="#">HuuPhat</a></small></p><div class="entry"><p>'.$dulieu['overview'].'</p></div>';
        }
        if(empty($data)){
            echo 'khong co bai viet';
        }
    }
    ?>
        </div>
    <!-- DC Pagination:A1 Start -->
    <!-- DC Pagination:A1 End -->
</div>

